import { BaseViewModel } from '@ohos/lib_common'
import { API } from '../../../common/constants/api'

// 节目信息 item
export interface ProgramItem {
  schedulId: string
  programId: string
  programName: string
  compereId: string
  compereName: string
  pictureUrl: string
  logoUrl: string
  sowingUrl: string
  startTime: string
  endTime: string
  topicId: string
  topicName: string
  status: number
  isSubscibe: boolean
  listenCount: number
}

// 请求数据
export class ProgramModel extends BaseViewModel {
  async getPrograms() {
    const res = await this.get<ProgramItem[]>({ url: API.PROGRAMS })
    return res;
  }
}

export const programModel = new ProgramModel()